package com.bmft;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.Toast;

public class CheckBoxActivity08 extends AppCompatActivity {

    private CheckBox checkbox_06;
    private CheckBox checkbox_05;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_check_box08);
        //find
        checkbox_05 = findViewById(R.id.checkbox_05);
        checkbox_06 = findViewById(R.id.checkbox_06);
        checkbox_05.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                Toast.makeText(CheckBoxActivity08.this,buttonView.getText()+" check changed",Toast.LENGTH_SHORT).show();
            }
        });
        checkbox_06.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                Toast.makeText(CheckBoxActivity08.this,buttonView.getText()+" check changed",Toast.LENGTH_SHORT).show();
            }
        });
    }

    public void backToMain(View view) {
        Intent intent = new Intent(CheckBoxActivity08.this, MainActivity.class);
        startActivity(intent);
    }
}